home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The PC-SIG Library 10
/
The PC-Sig Library - Shareware for the IBM PC and Compatibles (PC-SIG)(Tenth Edition Disks 1-2804)(1991).iso
/
PC_SIGCD
/
04
/
4
/
DISK0442.ZIP
/
TIMEDAT4.PAS
< prev
Wrap
Pascal/Delphi Source File
|
1989-02-08
|
878b
|
33 lines
function clock: TDString;
var
hour,min,sec: string[2];
hr,mn,sc,hn: word;
begin
gettime(hr,mn,sc,hn);
str(hr,hour); {convert to string}
str(mn,min); { " }
str(sc,sec); { " }
if length(min)=1 then min:='0'+min;
if length(sec)=1 then sec:='0'+sec;
clock := hour+':'+min+':'+sec;
end;
function Date: TDString;
var
month,day: string[2];
year: string[4];
mn,dy,yr,dow: word;
begin
getdate(yr,mn,dy,dow);
str(yr,year); {convert to string}
str(dy,day); { " }
str(mn,month); { " }
if length(day)=1 then day:='0'+day;
if length(month)=1 then month:='0'+month;
Delete(year,1,2);
date := month+'/'+day+'/'+year;
end;